<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoodsSkuToMaterialsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_sku_to_materials', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('goods_sku_id')->index()->nullable()->comment('商品skuID');
            $table->integer('material_id')->index()->nullable()->comment('材料ID');
            $table->integer('number')->index()->nullable()->comment('数量');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('godds_sku_to_materials');
    }
}
